package com.qch.rocketmq.springboot_ms_rocketmq.schedule;

import com.qch.rocketmq.springboot_ms_rocketmq.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author qch
 * @Date 2021/6/24
 */
@Slf4j
@Component
public class OrderTask {
    @Autowired
    private OrderService ordersService;

    @Scheduled(cron = "*/30 * * * * ?")
    public void scanExpireOrder() {
        log.info("检查超时订单......");
        ordersService.passTimeProcess(20);
    }
}
